#include "stdafx.h"
#include <boost/test/auto_unit_test.hpp>
#include <sstream>
#include "detail/bmock_out_arg_val.hpp"
#include "detail/bmock_out_raw_mem_ptr.hpp"
#include "detail/bmock_expand_arg.hpp"

namespace bmock {
#define VAL3              769
	static const size_t LEN = 234;

	static std::string test_func(int* x) {
		return BOOST_PP_STRINGIZE(__BMOCK_EXPAND_ARG(OUT(x)));
	}
	static std::string test_raw_mem_func(const size_t l,unsigned char* x){
		return BOOST_PP_STRINGIZE(__BMOCK_EXPAND_ARG(RAW_MEM(OUT,x,l)));
	}

	BOOST_AUTO_TEST_CASE(test_OUT_Macro_ARG) {
		int val2 = 679;
		const char expected[] = "bmock::make_out_arg_val(\"x\",x)";
		BOOST_CHECK_EQUAL(expected,test_func(&val2));
	}

	BOOST_AUTO_TEST_CASE(test_RAW_MEM_OUT_Macro_ARG) {
		unsigned char     val2[LEN];
		const char expected[] = "new bmock::out_raw_mem_ptr(\"x\",x,bmock::__raw_mem(x,l))";
		BOOST_CHECK_EQUAL(expected,test_raw_mem_func(LEN,val2));
	}
}
